<?php
require_once 'systemA/ConcreteFactoryA.php';
require_once 'systemB/ConcreteFactoryB.php';
use example\abstractFactory\systemA\ConcreteFactoryA;
use example\abstractFactory\systemB\ConcreteFactoryB;
//资讯系统
$nav = [
    '<div style="display: inline-block;width: 20%;">热点新闻</div>',
    '<div style="display: inline-block;width: 20%;">国际要闻</div>',
    '<div style="display: inline-block;width: 20%;">我的推荐</div>',
    '<div style="display: inline-block;width: 20%;">资讯设置</div>'
];
$text = '<input type="text" value="资讯系统" style="height: 30px;border-radius: 5px;border-width: 1px;">';
//echo htmlspecialchars_decode('<h2>资讯系统</h2>');
$news = new ConcreteFactoryA();
echo ($news->createNav($nav))->render();
echo '<br>';
echo ($news->createText($text))->render();


//交友社区系统
$nav = [
    '<div style="display: inline-block;width: 20%;">我的群组</div>',
    '<div style="display: inline-block;width: 20%;">我的好友</div>',
    '<div style="display: inline-block;width: 20%;">好友圈</div>',
    '<div style="display: inline-block;width: 20%;">兴趣圈</div>'
];
$btn = [
    '<button style="height: 30px;
    width: 60px;
    border-radius: 5px;
    border-width: 1px;
    background-color: #eeeeee;">确定</button>'
];
//echo htmlspecialchars_decode('<h2>交友社区系统</h2>');
$friends = new ConcreteFactoryB();
echo ($friends->createNav($nav))->render();
echo '<br>';
echo ($friends->createBtn($btn))->render();
